package com.haorui.lygyd.autotas.task;

import com.haorui.autotask.task.ScheduleBaseTask;
import com.haorui.lygyd.payordermanager.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 每2个小时自动删除已取消的订单。
 * Created by Administrator on 2018/3/12.
 */
@Service
@Slf4j
public class TaskDeleteCanledOrder implements ScheduleBaseTask {
    @Autowired
    private OrderService orderService;
    @Override
    public void runTask() throws Exception {
        log.debug("开始自动删除已取消的订单");
        orderService.deleteCanledOrder();
        log.debug("完成自动删除已取消的订单");
    }
}
